package com.example.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Description: 商品评论实体类
 * @Author: aimi
 * @Create: 2024-05-16
 **/
@Data
public class SpuComment {
    @TableId(type = IdType.AUTO)
    private Long id;
    private Long parentId;
    private Long userId;
    private Long spuId;
    private String content;
    // 评论图片地址，以||分割
    private String contentImg;
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    // 是否展示
    private boolean status;
    @TableLogic(delval = "1")
    private boolean deleted;
    private Integer likes;
    private int score;
    // 评论类型 ，与评分对应 ，1（好评5-4）2（中评3-2）3（差评1）
    private int type;
    @TableField(exist = false)
    private Integer skuId;
}